﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using demo.BLL;
using demo.Entity;
using iAgileFramework.DataTransCarrier;

namespace WebApplication1.Areas.Manage.Controllers
{
    public class HomeController : ControllerBase
    {
        private WebSiteInfoBLL bll = new WebSiteInfoBLL();
        // GET: Manage/Home
        public ActionResult Index()
        {
            WebSiteInfo model= bll.GetModel();
            return View(model);
        }
        /// <summary>
        /// 新增站点信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Add(WebSiteInfo model)
        {
            var rv = new ReturnValue();
            rv = base.ModelValidate();
            return !rv.State ? this.Json(rv) : this.Json(model.Id!=0 ? bll.Update(model) : bll.Add(model));
        }
       
    }
}